//
//  MusicCD02Widget.swift
//  TimMusic
//
//  Created by nkl on 2024/10/17.
//

import Foundation
import SwiftUI

struct Small_MusicCD01_02: View {
    var model: ControlMusicModel
    var body: some View {
        ZStack {
            if let data = model.imageData, let uiImage = UIImage(data: data) , !model.isStatic {
                Image(uiImage: uiImage).resizable()
                    .resizable().blur(radius: 10).ignoresSafeArea()
            } else {
                Image("ic_small_placeholder").resizable().blur(radius: 10).ignoresSafeArea()
            }
            VStack {
                Text(model.title)
                    .font(.system(size: 16))
                    .foregroundColor(.white)
                Text(model.auth).font(.system(size: 12))
                    .foregroundColor(.white.opacity(0.6))
                    .padding(.top,12)
                Spacer()
            }.padding(.top,20)
            MusicCDWidget(hasArrow: false,bgColor: .clear,model: model).offset(y:80).clipped()
        }
    }
}

